use constant {
  PPCADDR_PAGETABLE_AREA => 0xf0000000,
  PPCADDR_DRAM_NC        => 0x88000000,
  MM_PAGEMASK            => 0xC0000000,
  MM_PS1                 => 0x00000000,
  MM_PS8                 => 0x40000000,
  MM_MMUMASK             => 0x3FFFFFFF,
  MM_INDEXPS1            => 0x00000000,
  MM_INDEXPS8            => 0x00000003,
  DRAM_COPYENGINE_AREA   => 0x00100000,
  SIZE_COPYENGINE_AREA   => 0x00040000
};

sub Adr_rTableToPpc {
  my $rTable = shift;
  if ( ($rTable & MM_PAGEMASK) == MM_PS8 ) {
    return (PPCADDR_PAGETABLE_AREA + (($rTable & MM_MMUMASK)>>MM_INDEXPS8)*4);
  } elsif ( ($rTable & MM_PAGEMASK) == MM_PS1 ) {
    return (PPCADDR_PAGETABLE_AREA + (($rTable & MM_MMUMASK)>>MM_INDEXPS1)*4);
  }
  return 0;
}

sub Adr_DramToPpc {
  my $DramAddr = shift;
  return $DramAddr + PPCADDR_DRAM_NC;
}
